# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ProximityBeacon.V1beta1.Model.Diagnostics do
  @moduledoc """
  Diagnostics for a single beacon.

  ## Attributes

  *   `alerts` (*type:* `list(String.t)`, *default:* `nil`) - An unordered list of Alerts that the beacon has.
  *   `beaconName` (*type:* `String.t`, *default:* `nil`) - Resource name of the beacon. For Eddystone-EID beacons, this may
      be the beacon's current EID, or the beacon's "stable" Eddystone-UID.
  *   `estimatedLowBatteryDate` (*type:* `GoogleApi.ProximityBeacon.V1beta1.Model.Date.t`, *default:* `nil`) - The date when the battery is expected to be low. If the value is missing
      then there is no estimate for when the battery will be low.
      This value is only an estimate, not an exact date.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :alerts => list(String.t()),
          :beaconName => String.t(),
          :estimatedLowBatteryDate => GoogleApi.ProximityBeacon.V1beta1.Model.Date.t()
        }

  field(:alerts, type: :list)
  field(:beaconName)
  field(:estimatedLowBatteryDate, as: GoogleApi.ProximityBeacon.V1beta1.Model.Date)
end

defimpl Poison.Decoder, for: GoogleApi.ProximityBeacon.V1beta1.Model.Diagnostics do
  def decode(value, options) do
    GoogleApi.ProximityBeacon.V1beta1.Model.Diagnostics.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ProximityBeacon.V1beta1.Model.Diagnostics do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
